package com.wlhse.service.impl;
import com.wlhse.dto.SupervisionTaskDto;
import com.wlhse.entity.SupervisionTaskPojo;
import com.wlhse.exception.WLHSException;
import com.wlhse.service.SupervisionTaskService;
import com.wlhse.dao.SupervisionTaskDao;
import com.wlhse.util.state_code.NR;
import org.springframework.stereotype.Service;
import java.util.List;

import javax.annotation.Resource;

@Service
public class SupervisionTaskImpl implements SupervisionTaskService{

    @Resource
    private SupervisionTaskDao supervisionTaskDao;


    @Override
    public String querySupervisionTask(SupervisionTaskDto supervisionTaskDto) {
        try{
            List<SupervisionTaskPojo> supervisionTaskPojo = supervisionTaskDao.querySupervisionTask(supervisionTaskDto);
            if(supervisionTaskPojo==null){
                String data= NR.r("查询结果为空！");
                return data;
            }else{
                    String data=NR.r(supervisionTaskPojo);
                    return data;
            }
        }catch (Exception e){
            e.printStackTrace();
            throw new WLHSException("查询失败!");
        }
    }
}
